package com.user.UserAction;

import java.io.InputStream;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.opensymphony.xwork2.ActionSupport;
import com.user.service.UserInfoService;

public class updateAction extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String tellnumber;
	private String password;
	private String name;
	private String format;
	private String token;
	private InputStream update;
	private ApplicationContext applicationContext;
	
	public String execute() throws Exception{
		String xmlPath = "applicationContext.xml";
		applicationContext = new ClassPathXmlApplicationContext(xmlPath);
		UserInfoService s = (UserInfoService) applicationContext.getBean("UserInfoService");
		update = s.setUpdate(tellnumber, password);
		return "success";
	}



	public InputStream getUpdate() {
		return update;
	}

	public void setUpdate(InputStream update) {
		this.update = update;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	public String getTellnumber() {
		return tellnumber;
	}
	public void setTellnumber(String tellnumber) {
		this.tellnumber = tellnumber;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getFormat() {
		return format;
	}
	public void setFormat(String format) {
		this.format = format;
	}
}
